<template>
	<view class="container">
		<view class="swiper">
			<u-swiper :list="list"></u-swiper>
		</view>
	</view>
</template>

<script>
	import request from '@/utils/request'
	export default {
		components: {},
		data() {
			return {
				list: []
			};
		},

		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad(options) {
			this.getIndexData()
		},

		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow() {},

		methods: {
			//获取首页数据
			async getIndexData() {
				const {
					data: {
						pageData
					}
				} = await request.get('page/detail', {
					pageId: 0
				})
				let imgList = pageData.items[1].data
				for (let i = 0; i < imgList.length; i++) {
					this.list.push(imgList[i].imgUrl)
				}
			}
		},
	};
</script>

<style lang="scss" scoped>
	.container {
		background: #fff;
	}
</style>